package com.hui.li.util;

/**
 * @projectName: Spring-RestTemplate
 * @package: com.hui.li.controller
 * @className: AsyncFactory
 * @author: Hui
 * @date: 2021/12/22 23:25
 */
public class AsyncFactory {
    public static Runnable sendCode(String phone,String code){
        return new Runnable() {
            //返回Runnable接口的实现类
            @Override
            public void run() {
                //开启休眠5秒
                try {
                    Thread.sleep(5000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                //开启线程
                System.out.println(Thread.currentThread().getName()+"=======该睡觉了......");
            }
        };
    }
}
